package com.ajzhang.facade;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ajzhang.bean.BillType;

public class BillTypeFacade extends AbstractFacade {

	@Transactional(propagation = Propagation.REQUIRED)
	public void save(BillType billType) {
		this.baseDao.insert(billType);
	}

	@Transactional(propagation = Propagation.REQUIRED)
	public void update(BillType billType) {
		this.baseDao.update(billType);
	}

	@Transactional(propagation = Propagation.REQUIRED)
	public void delete(BillType billType) {
		this.baseDao.delete(billType);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public List<BillType> findAll() throws Exception {
		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(BillType.class);
		return this.baseDao.findByCriteria(detachedCriteria);
	}

}
